#pragma once
#include<mysql/mysql.h>
#include <iostream>
#include <string>
#include <valarray>
#include <vector>
 #include <iostream>
#include <cstring>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <unordered_map>

using namespace std;

typedef struct student {
    int stuId;
    string stuName;
    string className;
	string password;
}Student;
 typedef  struct people{
    int id;
    string name;
 } Friendname;
class StudentManager {
private:
    StudentManager();
    ~StudentManager();
public:
    static StudentManager* GetInstance() { //单例修改
        static StudentManager StudentManager;
        return &StudentManager;
		
    }
public:
    // 增上改查
    bool insertStu(Student& stu);
    bool updateStu(Student& stu);
    bool deleteStu(int stuId);
    vector<Student> queryStu(string condition = "");
private:
    MYSQL* conn;
	const char *host = "localhost";
    const char * user = "root";
    const  char *pwd = "MyPass123!";
    const char* tableName = "student";
    const char* dbName = "test";

    const unsigned short port = 3306;
	
};
